package shiro.com.controller.sys;

import java.util.List;

import com.alibaba.fastjson.JSON;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authc.IncorrectCredentialsException;
import org.apache.shiro.authc.UnknownAccountException;
import org.apache.shiro.subject.Subject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import shiro.com.basie.controller.BaseController;
import shiro.com.basie.domain.AjaxResult;
import shiro.com.basie.domain.Result;
import shiro.com.domain.sys.SysResoureTest;
import shiro.com.domain.TableDataInfo;
import shiro.com.domain.sys.SysUsers;
import shiro.com.domain.sys.vo.PermissionListVo;
import shiro.com.domain.sys.vo.SysResoureVo;
import shiro.com.service.sys.ISysResoureTestService;
import shiro.com.utils.shiro.token.JwtToken;
import shiro.com.utils.shiro.util.JwtUtil;

import static shiro.com.basie.domain.AjaxResult.success;

/**
 * 【请填写功能名称】Controller
 *
 * @author ruoyi
 * @date 2022-11-09
 */

@RestController
@CrossOrigin
@RequestMapping("/system/resoure")
public class SysResoureTestController extends BaseController
{
    @Autowired
    private ISysResoureTestService sysResoureTestService;

    /**
     * 查询【请填写功能名称】列表
     */
    @GetMapping("/list")
    public TableDataInfo list(SysResoureTest sysResoureTest)
    {
        List<SysResoureVo> mapList = sysResoureTestService.selectSysResoureTestList(sysResoureTest);
        return getDataTable(mapList);
    }

    @GetMapping(value = "/roleList")
    public TableDataInfo list(String userName)
    {
        List<PermissionListVo> mapList = sysResoureTestService.selectSysResoureRoleList(userName);

        return getDataTable(mapList);
    }

    @PostMapping(value = "/btnShow")
    public AjaxResult btnShow(String btnName)
    {


        return toAjax(sysResoureTestService.selectbtnList(btnName));
    }
//    /**
//     * 导出【请填写功能名称】列表
//     */
//    @PostMapping("/export")
//    public void export(HttpServletResponse response, SysResoureTest sysResoureTest)
//    {
//        List<SysResoureTest> list = sysResoureTestService.selectSysResoureTestList(sysResoureTest);
//        ExcelUtil<SysResoureTest> util = new ExcelUtil<SysResoureTest>(SysResoureTest.class);
//        util.exportExcel(response, list, "【请填写功能名称】数据");
//    }
//
//    /**
//     * 获取【请填写功能名称】详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:query')")
//    @GetMapping(value = "/{sysReId}")
//    public AjaxResult getInfo(@PathVariable("sysReId") Long sysReId)
//    {
//        return success(sysResoureTestService.selectSysResoureTestBySysReId(sysReId));
//    }
//
//    /**
//     * 新增【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:add')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody SysResoureTest sysResoureTest)
//    {
//        return toAjax(sysResoureTestService.insertSysResoureTest(sysResoureTest));
//    }
//
//    /**
//     * 修改【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:edit')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
//    @PutMapping
//    public AjaxResult edit(@RequestBody SysResoureTest sysResoureTest)
//    {
//        return toAjax(sysResoureTestService.updateSysResoureTest(sysResoureTest));
//    }
//
//    /**
//     * 删除【请填写功能名称】
//     */
//    @PreAuthorize("@ss.hasPermi('system:test:remove')")
//    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
	@DeleteMapping("/{sysReIds}")
    public AjaxResult remove(@PathVariable Long[] sysReIds)
    {
        return toAjax(sysResoureTestService.deleteSysResoureTestBySysReIds(sysReIds));
    }
}
